package wh.FloatingViewGroupRunner;

import wh.FloatingViewGroup.FloatingViewGroup;
import Yki.PaperPlaneClient.FriendContent;
import Yki.PaperPlaneClient.R;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class FloatingViewGroupActivity extends Activity {
	Context context;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;

        requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);  
        
        FloatingViewGroup floatingViewGroup=new FloatingViewGroup(this);
        floatingViewGroup.setBackgroundDrawable(getResources().getDrawable(R.drawable.main_background));
        floatingViewGroup.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(context, FriendContent.class);
				intent.putExtra("ID", arg2+"");
				startActivity(intent);
			}
		});
        TestViewsAdapter testViewsAdapter=new TestViewsAdapter();
        floatingViewGroup.setAdapter(testViewsAdapter);
        setContentView(floatingViewGroup);
    }
}